package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表和折扣券关联表
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-07-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_dis_count_or_user")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuDisCountOrUser extends Model<GuDisCountOrUser> {

    private static final long serialVersionUID = 1L;
    @TableId(value = "du_id", type = IdType.AUTO)
    private Integer duId;

    /**
     * 优惠券id
     */
    private Integer duDisCountId;

    /**
     * 用户Id
     */
    private Integer duUserId;

    /**
     * 券码
     */
    private String duCounponCode;
    private String duBeOverdue;
    private Integer duIsUse;

    private LocalDateTime duInputTime;

    private LocalDateTime duUpdateTime;

    @TableField(exist = false)
    private GuUser user;
    @TableField(exist = false)
    private GuDiscount discount;

    @TableField(exist = false)
    private String dcTitle;

    /**
     * 折扣门槛
     */
    @TableField(exist = false)
    private BigDecimal dcThreshold;

    /**
     * 折扣
     */
    @TableField(exist = false)
    private BigDecimal dcDiscountSize;
    /**
     * 图片
     */
    @TableField(exist = false)
    private Integer dcBeOverdue;
    @TableField(exist = false)
    private Integer dcIsUse;
    @TableField(exist = false)
    private String dcImages;

    @Override
    protected Serializable pkVal() {
        return this.duId;
    }

}
